// banner
$.ajax({
    url:"http://localhost:3000/databases/banner.json",
    success:(res)=>{
        $(".my_home_banner").banner(res,{
        
        })
    },
    dataType:"json"
})
// index_block_01
$.ajax({
    url:"http://localhost:3000/databases/index_block_01.json",
    success:(res)=>{ 
        let str = "";
        res.forEach((res)=>{
        str += `
                <a href="#" class="pp_a fl">
                    <p class="p_img">
                        <img src="${res.src}" alt="">
                    </p>
                </a>
                `
        })
        $(".index_block_01").html(str);
    },
    dataType:"json"
})
// index_block_02
$.ajax({
    url:"http://localhost:3000/databases/index_block_02.json",
    success:(res)=>{ 
        let str = "";     
                str += `
                <p class="p_img">
                    <img src="${res[0].src}" alt="">
                </p>
                <div class="p_txt">
                    <p class="p1">佟丽娅同款</p>
                    <p class="p2">满星欢喜都为你</p>
                </div>`
            $(".ran02 .left_block02").html(str);
        let hm= "";
                hm +=`   
                <a href="#" class="fl">
                    <img src="${res[1].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src=".${res[2].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[3].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[4].src}" alt="">
                </a>`
         $(".ran02 .dren_list").html(hm)
        },
    dataType:"json"
    })
// block03
$.ajax({
    url:"http://localhost:3000/databases/index_block_03.json",
    success:(res)=>{ 
        let str = "";
                str += `
                <p class="p_img">
                    <img src="${res[0].src}" alt="">
                </p>
                <div class="p_txt">
                    <p class="p1">劳力士 全网低价捡漏</p>
                    <p class="p2">潜航者/迪通拿/日志型</p>
                 </div>`
            $(".ran03 .left_block02").html(str);
        let hm= "";
                hm +=`   
                <a href="#" class="fl">
                    <img src="${res[1].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src=".${res[2].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[3].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[4].src}" alt="">
                </a>`
         $(".ran03 .dren_list").html(hm)
        },
    dataType:"json"
    })
// block 04
$.ajax({
    url:"http://localhost:3000/databases/index_block_04.json",
    success:(res)=>{ 
        let str = "";

                str += `
                <p class="p_img">
                    <img src="${res[0].src}" alt="">
                </p>
                <div class="p_txt">
                    <p class="p1">简约设计 绅士魅力</p>
                    <p class="p2">直降2700，12期免息</p>
                </div>
                `
            $(".ran04 .left_block02").html(str);
        let hm= "";
                hm +=`   
                <a href="#" class="fl">
                    <img src="${res[1].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src=".${res[2].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[3].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[4].src}" alt="">
                </a>`
         $(".ran04 .dren_list").html(hm)
        },
    dataType:"json"
    })  
// block 05
$.ajax({
    url:"http://localhost:3000/databases/index_block_05.json",
    success:(res)=>{ 
        let str = "";
                
                str += `
                <p class="p_img">
                    <img src="${res[0].src}" alt="">
                </p>
                <div class="p_txt">
                    <p class="p1">专业军表 500米专业防水</p>
                    <p class="p2">12期免息，防弹衣特殊材质</p>
                </div>
                `
            $(".ran05 .left_block02").html(str);
        let hm= "";
                hm +=`   
                <a href="#" class="fl">
                    <img src="${res[1].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src=".${res[2].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[3].src}" alt="">
                </a>
                <a href="#" class="fl">
                    <img src="${res[4].src}" alt="">
                </a>`
         $(".ran05 .dren_list").html(hm)
        },
    dataType:"json"
    })  
// floor
$(".list").children("li").click(function(){
    $("html").animate({
        scrollTop: $('.index_block_02').eq($(this).index()).offset().top
    })
})

